<layout name="master"/>
<div class="btn-group" style="margin: 20px 0px">
    <a href="{:U('admin/links/add')}" class="btn btn-success">添加友链</a>
</div>
<table class="table table-hover">
    <thead>
    <tr>
        <th>编号</th>
        <th>友链名称</th>
        <th>友链URL</th>
        <th>友链排序</th>
        <th>友链添加人</th>
        <th>操作</th>
    </tr>
    </thead>
    <tbody>
    <foreach name="links" item="vo">
        <tr>
            <td>{$vo['lid']}</td>
            <td>{$vo['lname']}</td>
            <td>{$vo['lurl']}</td>
            <td>{$vo['lsort']}</td>
            <td>{$vo['adduser']}</td>
            <td>
                <div class="btn-group">
                    <a href="{:U('add',['lid'=>$vo['lid']])}" class="btn btn-info">编辑</a>
                    <a href="javascript:;" onclick="del({$vo['lid']})" class="btn btn-danger">删除</a>
                </div>
            </td>
        </tr>
    </foreach>
    </tbody>
</table>
<script>
  function del(lid){
      util.confirm('确定删除吗?',function(){
          location.href="__ROOT__/index.php/admin/links/del/lid/"+lid;
      })
  }
</script>